#include "StaticWindow.h"
#include "WndProcPicker.h"



namespace Zaf {
namespace Mwl {


const wchar_t* const StaticWindow::ClassName = L"STATIC";
__Internal::WndProcPicker StaticWindow::StaticWndProc(StaticWindow::ClassName);


StaticWindow::StaticWindow() {

}



StaticWindow::StaticWindow(WORD id) : ControlWindow(id) {

}



StaticWindow::~StaticWindow() {

}



HWND StaticWindow::CreateConcreteWindow() {

	unsigned int x;
	unsigned int y;
	GetPosition(x, y);

	unsigned int width;
	unsigned int height;
	GetSize(width, height);

	return CreateWindowEx(
		GetExStyle(),
		ClassName,
		GetText().c_str(),
		GetStyle(),
		x,
		y,
		width,
		height,
		GetParentOrOwner(),
		(HMENU)GetID(),
		GetModuleHandle(NULL),
		0
	);
}



DWORD StaticWindow::GetStaticType() const {
	return GetStyle() & SS_TYPEMASK;
}



void StaticWindow::SetStaticType(DWORD value) {
	SetStyle(GetStyle() & ~SS_TYPEMASK | value);
}



LRESULT StaticWindow::DefWndProc(const WndMsg& msg) {
	return StaticWndProc(msg.Hwnd, msg.Message, msg.WParam, msg.LParam);
}


}
}